package com.alibaba.dubbo.demo;

import com.alibaba.dubbo.rpc.RpcContext;

import cn.aruan.dcp.session.SessionHolder;

public class SessionHolderImpl implements SessionHolder {

	@Override
	public String getSession() {
		return RpcContext.getContext().getRequestHeaders().getHeader("session-id");
	}

	@Override
	public void setSession(String session) {
		RpcContext.getContext().getResponseHeaders().setHeader("session-id", session);
	}

	@Override
	public String getValue(String key) {
		return RpcContext.getContext().getRequestHeaders().getHeader(key);
	}

	@Override
	public void setValue(String key, String value) {
		RpcContext.getContext().getResponseHeaders().setHeader(key, value);
	}

}
